CC=gcc
CFLAGS=-c -fPIC -Wall -ggdb -std=c99 -pedantic-errors -D_GNU_SOURCE
GCFLAGS=`pkg-config --cflags glib-2.0`
GLIBS=`pkg-config --libs glib-2.0`
OBJECTS=Lexicon.o LexiconIter.o Node.o Lexer.o Token.o util.o

%.o: %.c
	$(CC) $(CFLAGS) $(GCFLAGS) -c $< -o $@

libparser.so: $(OBJECTS)
	$(CC) -lm $(GLIBS) -shared -Wl,-soname,$@ -o $@.1 $(OBJECTS)

clean:
	rm -f *.o
